/*
 * @Author: zhouwr 1551541860@qq.com
 * @Date: 2024-02-21 16:02:27
 * @LastEditors: zhouwr 1551541860@qq.com
 * @LastEditTime: 2024-02-28 22:22:52
 * @FilePath: /jeecgboot-vue3/src/views/activiti/procdef/components/actProcessDefConfig/business/ConfigBusiness.data.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import { FormSchema } from '/@/components/Form'

//自定义表单字段
export const formSchemas: FormSchema[] = [
  {
    label: 'id',
    field: 'id',
    component: 'Input',
    labelWidth: '150px',
    //一列占比总共24，比如一行显示2列
    colProps: { span: 18 },
    dynamicDisabled: true,
    ifShow({ values }) {
      console.log(values)
      return values.id
    },
  },
  {
    label: '流程定义Id',
    field: 'procdefId',
    component: 'Input',
    labelWidth: '150px',
    //一列占比总共24，比如一行显示2列
    colProps: { span: 18 },
    dynamicDisabled: true,
  },
  {
    //标题名称
    label: '流程业务标题规则',
    //字段
    field: 'businessTitleRule',
    component: 'Select',
    //填写组件Select的属性
    componentProps: {
      options: [
        { label: '表达式', value: 1 },
        { label: 'JavaClasspath', value: 2 },
        { label: 'SpringBean', value: 3 },
      ],
    },
    //默认值
    defaultValue: 1,
    //标题宽度,支持数字和字符串
    labelWidth: 150,
    //一列占比总共24，比如一行显示2列
    colProps: { span: 18 },
    // rules: [{ required: true, message: '请选择流程实例名称规则' }],
  },
  {
    label: '流程业务标题',
    field: 'businessTitle',
    component: 'Input',
    labelWidth: '150px',
    //一列占比总共24，比如一行显示2列
    colProps: { span: 18 },
    rules: [{ required: true, message: '请输入流程实例名称' }],
  },
  {
    label: '移动端组件路径',
    field: 'mobileComponentPath',
    component: 'Input',
    labelWidth: '150px',
    //一列占比总共24，比如一行显示2列
    colProps: { span: 18 },
  },
  {
    label: 'PC端组件路径',
    field: 'pcComponentPath',
    component: 'Input',
    labelWidth: '150px',
    //一列占比总共24，比如一行显示2列
    colProps: { span: 18 },
    rules: [{ required: true, message: '请输入PC端组件路径' }],
  },
  {
    label: '流程实例Id列名',
    field: 'processInstanceIdCol',
    component: 'Input',
    labelWidth: '150px',
    //一列占比总共24，比如一行显示2列
    colProps: { span: 18 },
  },
  {
    label: '流程实例状态列名',
    field: 'processInstanceStatusCol',
    component: 'Input',
    labelWidth: '150px',
    //一列占比总共24，比如一行显示2列
    colProps: { span: 18 },
  },
  {
    label: '创建人',
    field: 'createBy',
    component: 'JSelectUser',
    labelWidth: '150px',
    //一列占比总共24，比如一行显示2列
    colProps: { span: 18 },
    dynamicDisabled: true,
    componentProps: {
      labelKey: 'realname',
      rowKey: 'id',
    },
    ifShow({ values }) {
      console.log(values)
      return values.id
    },
  },
  {
    label: '创建时间',
    field: 'createTime',
    component: 'Input',
    labelWidth: '150px',
    //一列占比总共24，比如一行显示2列
    colProps: { span: 18 },
    dynamicDisabled: true,
    ifShow({ values }) {
      console.log(values)
      return values.id
    },
  },
  {
    label: '更新人',
    field: 'updateBy',
    component: 'JSelectUser',
    labelWidth: '150px',
    //一列占比总共24，比如一行显示2列
    colProps: { span: 18 },
    componentProps: {
      labelKey: 'realname',
      rowKey: 'id',
    },
    dynamicDisabled: true,
    ifShow({ values }) {
      console.log(values)
      return values.id
    },
  },
  {
    label: '更新时间',
    field: 'updateTime',
    component: 'Input',
    labelWidth: '150px',
    //一列占比总共24，比如一行显示2列
    colProps: { span: 18 },
    dynamicDisabled: true,
    ifShow({ values }) {
      console.log(values)
      return values.id
    },
  },
  {
    label: '备注',
    field: 'remark',
    component: 'InputTextArea',
    labelWidth: '150px',
    //一列占比总共24，比如一行显示2列
    colProps: { span: 18 },
  },
]

export const businessFormConfig = {
  //注册表单列
  schemas: formSchemas,
  //回车提交
  autoSubmitOnEnter: false,
  //不显示重置按钮
  showResetButton: false,
  showSubmitButton: false,
  //自定义提交按钮文本和图标
  // submitButtonOptions: { text: '提交', preIcon: '' },
  //查询列占比 24代表一行 取值范围 0-24
  actionColOptions: { span: 24 },
}
